#!/bin/bash
set -e

cd $(dirname $0)/..

echo "Running validation"

if [[ -z "$(command -v golangci-lint)" ]]; then
	echo "no golangci-lint available, using go fmt/vet instead"
	echo "Running: go fmt"
	go fmt ./...
	echo "Running: go vet"
	go vet -tags=test ./...
	exit
fi

echo "Running: golangci-lint run"
golangci-lint run
